package pam.web;

import pam.core.XMLObject;

/**
 * 提示消息
 * 
 */
public class Message implements XMLObject {
	private int code = 1;
	private String description;

	public Message() {
	}

	public Message(String description) {
		setDescription(description);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String toXML() {
		StringBuffer sb = new StringBuffer();
		sb.append("<Message>");
		sb.append("<Code>");
		sb.append(getCode());
		sb.append("</Code>");
		sb.append("<Description>");
		sb.append("<![CDATA[");
		sb.append(getDescription() == null ? "" : getDescription());
		sb.append("]]>");
		sb.append("</Description>");

		sb.append("</Message>");
		return sb.toString();
	}

}